package com.qdlc.p2p.biz.processor.task.pay;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Qualifier;

import com.qdlc.p2p.biz.processor.event.LotteryCashValueEvent;
import com.qdlc.p2p.biz.processor.task.AbstractTaskProcessor;
import com.qdlc.p2p.biz.service.CollectPayService;
import com.qdlc.p2p.common.core.queue.TaskProcessorException;
import com.qdlc.p2p.common.core.queue.ValueEvent;
/**
 * Created by hongbl on 2016/2/4.
 */
public class LotteryCashPayTaskProcessor extends AbstractTaskProcessor {

    /** 代付业务处理 */
    @Resource
    @Qualifier("lotteryPayService")
    private CollectPayService lotteryPayService;

    @Override
    protected void process0(ValueEvent event) throws TaskProcessorException {
        LotteryCashValueEvent lotteryCashValueEvent = (LotteryCashValueEvent)event;
        lotteryPayService.requestOrder(lotteryCashValueEvent.getTppTradeLog());
    }

    @Override
    public boolean supports(ValueEvent event) {
        return event instanceof LotteryCashValueEvent;
    }
}
